# -*-coding:utf-8-*-


def insertionSort(iList):
    if len(iList) <= 1:
        return iList
    for right in range(1,len(iList)):
        target = iList[right]
        for left in range(0,right):
            if target <= iList[left]:
                iList[left+1:right+1] = iList[left:right]
                iList[left] = target
                break
            print(f'第{right}轮排序结果：',end='')
            print(iList)

    return iList
if __name__ == '__main__':
    lis = [8,5,6,7,3,0]
    print(insertionSort(lis))